package b_factorypattern.simple_factory;

/**

 * 使用简单工厂创建咖啡
 */
public class CoffeeStore {

    public Coffee orderCoffee(String type) {
        //声明Coffee类型的变量，根据不同类型创建不同的coffee子类对象
       SimpleCoffeeFactory simpleCoffeeFactory = new SimpleCoffeeFactory() ;
       Coffee coffee = simpleCoffeeFactory.createCoffee(type);
       coffee.addMilk();
       coffee.addsugar();
       return coffee ;
    }
}
